﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class admin1_SiteAdmin : System.Web.UI.MasterPage
{
    eStoreDataContext db = new eStoreDataContext();
  
    protected void Page_Init(object sender, EventArgs e)
    {
        //if (!this.IsPostBack)
        //    this.LoadTTUser();
    }
    private void LoadTTUser()
    {
        if (Session["SiteUser"] != null)
        {
            SiteUser nv = Session["SiteUser"] as SiteUser;
            lbl_username.Text = nv.FullName;
            var role = db.Roles.Single(r => r.RoleId == nv.RoleId);
            lbl_Role.Text = role.Name;

        }
        else
        {
            Response.Redirect("login.aspx");
        }
    }
    protected void lbt_Logout_Click(object sender, EventArgs e)
    {
        Session.Remove("SiteUser");
        Response.Redirect("login.aspx");
    }
}
